#!/usr/bin/env python
PACKAGE = "pure_event_reconstruction"

from dynamic_reconfigure.parameter_generator_catkin import *


gen = ParameterGenerator()

basic_group = gen.add_group("_1_Basic")
advanced_group = gen.add_group("_2_Advanced")

# Basic
basic_group.add("Auto_detect_contrast_thresholds", bool_t, 0,
"Enable adaptive contrast thresholds (ON/OFF) that self-recalibrate based APS frames.", False)

basic_group.add("Auto_adjust_dynamic_range", bool_t, 0,
"Dynamically adjust dynamic range of display image.", True)

basic_group.add("Cutoff_frequency", double_t, 0,
"The cutoff (crossover) frequency of the high-pass filter in Hz.", 0.06, 0, 20)

basic_group.add("Cutoff_frequency_per_event_component", double_t, 0,
"Per-event (event-rate dependent) component of the cutoff (crossover) frequency.", 0.06, 0, 1)

# Advanced
advanced_group.add("Contrast_threshold_OFF", double_t, 0,
"Change in log intensity required to trigger OFF event. "
"Requires Auto_detect_contrast_thresholds to be disabled.", -0.1, -0.2, 0)

advanced_group.add("Contrast_threshold_ON", double_t, 0,
"Change in log intensity required to trigger ON event. "
"Requires Auto_detect_contrast_thresholds to be disabled.", 0.1, 0, 0.2)

advanced_group.add("Intensity_min", double_t, 0, "Minimum displayed intensity. "
"Requires Auto_adjust_dynamic_range to be disabled.", -0.5, -1, 0.5)

advanced_group.add("Intensity_max", double_t, 0, "Maximum displayed intensity. "
"Requires Auto_adjust_dynamic_range to be disabled.", 1.5, 0.5, 2)

advanced_group.add("Spatial_filter_sigma", double_t, 0,
"Sigma parameter for the spatial filter. Set sigma = 0 to disable filtering.", 0, 0, 2)

advanced_group.add("Bilateral_filter", bool_t, 0,
"Use Bilateral filter on display images (default Gaussian filter). "
"Requires Spatial_filter_sigma > 0.", False)

advanced_group.add("Color_display", bool_t, 0,
"Toggle color display.", False)

exit(gen.generate(PACKAGE, "reconstruction_node", "pure_event_reconstruction"))
